package com.xxxx.shopsms.receive;

import com.xxxx.shopsms.util.SmsUtil;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
/**
 * @author nathan-wang on 2020-11-01
 */
@Component
//监听队列
@RabbitListener(queues = "queue_message")
public class Consumer {
    //接收消息后的处理方法
    @RabbitHandler
//    @RabbitListener(queues = "queue_msg")
    public void recv(String phone){
        System.out.println("接收消息再发短信:"+phone);
        SmsUtil.sendMsg(phone);
    }
}
